import { useEarlyWarningHttp } from '@/api/useHttp';
import { IEarlyWarning, R } from '@/api/types';

export enum EarlyWarningApi {
  earlyWarning = '/diseaseData/getAllData',
  refresh = '/diseaseData/getAllDataRefresh',
}

export const reqEarlyWarning = () => {
  return useEarlyWarningHttp<R<IEarlyWarning>>({
    url: EarlyWarningApi.earlyWarning,
    method: 'post',
  });
};

export const reqRefresh = () => {
  return useEarlyWarningHttp<R<null>>(
    {
      url: EarlyWarningApi.refresh,
      method: 'post',
    },
    false
  );
};
